<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <script>
        var str = "smyhvae";
        console.log(str.length); // 获取字符串的长度
        console.log(str[2]);
    </script>
</body>

</html>